<?php
namespace addons\xcrontab\library;
use think\exception\HttpResponseException;
use think\Response;

trait CheckInstallTrait
{

    protected function installOk()
    {

        if (is_dir(ADDON_PATH . 'crontab')) {
            return true;
        } else {
            //'本插件以来官方的定时任务插件，必须先安装官方定时任务插件才可以安装'
            $content = $this->fetch("xcrontab/info/check");
            throw new HttpResponseException(Response::create($content, 'html'));
        }
    }
}
